<!DOCTYPE html>
<html>
  <head>
    <title>{% block title %}CIS 525{% endblock %}</title>
    <link href="{{ STATIC_URL }}css/bootstrap.min.css" rel="stylesheet" />
    <link href="{{ STATIC_URL }}css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="{{ STATIC_URL }}css/font-awesome.css" rel="stylesheet" />
    <link href="{{ STATIC_URL }}css/facebook.css" type="text/css" rel="stylesheet" media="all" />
    <link href="{{ STATIC_URL }}datepicker/css/datepicker.css" type="text/css" rel="stylesheet" media="all" /> 
    <link href="{{ STATIC_URL }}timepicker/css/timepicker.css" type="text/css" rel="stylesheet" media="all" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% include 'django_facebook/_facebook_js.html' %}
    {% block extra_head %}{% endblock %} 
  </head>
  <body>
	<div class="navbar">
 			<div class="navbar-inner">
    		<a class="brand" href="/">MarathonPlanner</a>
    		<ul class="nav">
                {% if user.is_authenticated %}
                    <li><a href="{% url workout_index %}">Log</a></li>
                    <li><a href="{% url event_index %}">Event</a></li>
                {% endif %}
    		</ul>
    		<ul class="nav pull-right">
    			{% if user.is_authenticated %}
    				<li class="dropdown">
    					<a href="#" class="dropdown-toggle" data-toggle="dropdown">
    						{{ user.first_name }}
    						<b class="caret"></b>
    					</a>
    				<ul class="dropdown-menu">
    					<li><a href="{% url cis525.views.logout %}">Logout</a></li>
    				</ul>
    				</li>
				{% else %}
						<form class="navbar-form pull-right" action="{% url facebook_connect %}?facebook_login=1&next={{ request.path }}&register_next={{ request.path }}" method="post">
							<a class="btn btn-primary" href="javascript:void(0);" onclick="F.connect(this.parentNode);">
								<i class="icon-facebook"></i>
								Login
							</a>
<!--
							<input type="hidden" value="{{ request.path }}" name="register_next" />
							<input type="hidden" value="{{ request.path }}" name="next" />
-->
						</form>
				{% endif %}
			</ul>
  		</div>
	</div>
	<div class="container">

	{% if messages %}
    	{% for message in messages %}
    	<div{% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>
    		<button type="button" class="close" data-dismiss="alert">x</button>
    		{{ message|safe }}
    	</div>
    	{% endfor %}
	{% endif %}
	
	{% block content %}{% endblock %}
    </div>
    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/bootstrap.min.js" type="text/javascript"></script>
    {% if user.is_authenticated %}
    <script src="{{ STATIC_URL }}datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}timepicker/js/bootstrap-timepicker.js" type="text/javascript"></script>
    {% endif %}
    {% block extra_end %}{% endblock %}
    <script type="text/javascript">
        (function($){
            $(function() {
                $(".datepicker-widget").each(function () {
                    var options = { format: "mm/dd/yyyy"};

                    $(this).datepicker(options);
                    $(this).parent().find('.add-on').remove();
                });
            })
        })(jQuery);
    </script>
  </body>
</html>


